Skip to content

fix: guard nullable workbench/page access before dereferencing#1389

Merged
joaodinissf merged 1 commit into
dsldevkit:masterfrom
joaodinissf:fix/guard-workbench-access-chains
Jun 1, 2026
Merged

fix: guard nullable workbench/page access before dereferencing#1389
joaodinissf merged 1 commit into
dsldevkit:masterfrom
joaodinissf:fix/guard-workbench-access-chains

Conversation

@joaodinissf

Copy link
Copy Markdown
Collaborator

Two UI helpers walked workbench.getActiveWorkbenchWindow().getActivePage()… with no null checks, NPEing when there's no active window/page/editor:

  • PlatformPluginAwareEditorOpener.open() — the page lookup was outside the try, so the NPE escaped the IDE.openEditor error handling. Now guards getActiveWorkbenchWindow() (matching the in-file getProjectName() sibling) and falls back to the super.open() result when null.
  • CheckHyperlinkHelper.createHyperlinksByOffset() — guards the whole chain (the injected workbench is @Inject(optional = true), so nullable) and the active editor before getEditorInput(); falls through to super when null.

Found by a repo-wide inconsistency sweep.

🤖 Generated with Claude Code

Two UI helpers walked workbench.getActiveWorkbenchWindow().getActivePage()...
chains with no null checks, NPEing when there is no active window/page/editor:

- PlatformPluginAwareEditorOpener.open(): the page lookup was even outside the
  try, so the NPE escaped the IDE.openEditor error handling. Guard
  getActiveWorkbenchWindow() (matching the sibling getProjectName()); fall back
  to the super.open() result when null.
- CheckHyperlinkHelper.createHyperlinksByOffset(): guard the whole chain (the
  injected workbench is optional and may be null) and the active editor before
  getEditorInput(); fall through to super when null.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joaodinissf joaodinissf marked this pull request as ready for review May 30, 2026 16:38
@joaodinissf joaodinissf enabled auto-merge (rebase) May 30, 2026 16:38
@joaodinissf joaodinissf merged commit 1c5c93a into dsldevkit:master Jun 1, 2026
4 checks passed
@joaodinissf joaodinissf deleted the fix/guard-workbench-access-chains branch June 1, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants